package cn.haohaowo.dao;

import cn.haohaowo.annotation.MyBatisRepository;
import cn.haohaowo.entity.Book;
import com.sun.org.apache.xpath.internal.operations.Bool;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * Created by luwancai on 18/5/19.
 * DESC:
 */
@MyBatisRepository
public interface BookDao {

    Book getBookById(@Param("bookId") int bookId);

    List<Book> getBooks(@Param("type") String type,
                         @Param("title") String title,
                         @Param("author") String author,
                         @Param("publisher") String publisher,
                         @Param("minPrice") int minPrice,
                         @Param("maxPrice") int maxPrice,
                         @Param("minRow")int minRow,
                         @Param("pageSize")int pageSize);

    List<Book> getHotBooks();

    List<Book> getSearchBooks(@Param("keyword") String keyword);

    int insertBook(Book book);

    int updateBook(Book book);

    void createBookTable(@Param("tableName") String tableName);

}
